﻿<%@ Page Title="POSSystem | Roles" Theme="POSSystem" Language="C#" MasterPageFile="~/Application.Master"
    AutoEventWireup="true" CodeBehind="Roles.aspx.cs" Inherits="WebUI.Roles" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/Controls/SysControls/PageHeader.ascx" TagPrefix="uc" TagName="PageHeader" %>
<%@ Register Src="~/Controls/POSControls/RoleListCtrl.ascx" TagName="RoleList" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ApplicationHeadHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ApplicationContentHolder" runat="server">
    <script type="text/javascript">
        function onAddRole() {
            var id = getSelectedItemID<%=lstRoles.ClientID %>();
            var returnValue = window.showModalDialog('<%=GetRoleEditPageLink() %>' + '&mode=new', '', 'dialogWidth=450px;dialogHeight=300px;resizable=no;help=no;unadorned=yes;');

            return returnValue > 0;
        }

        function onSaveRole() {
            return confirm('Are you sure to save all changes?');
        }

        function onRemoveRole() {
            return confirm('Are you sure to delete checked items?');
        }
    </script>
    <uc:PageHeader ID="pageHeader" Text="Roles" ImageURL="~/Images/administrator-icon.png"
        runat="server" />
    <table width="100%">
        <tr>
            <td style="width: 100%; text-align: left; vertical-align: top">
                <asp:Panel ID="panel" runat="server" class="primaryPanel">
                    <div class="titleBar">
                        <asp:Label ID="lblTitle1" runat="server" CssClass="titleContent">Role List</asp:Label>
                    </div>
                    <div class="primaryFrameNoBorder">
                        <asp:UpdatePanel ID="updateRole" runat="server">
                            <ContentTemplate>
                                <table width="100%" class="toolbar">
                                    <tr>
                                        <td style='vertical-align: middle'>
                                            <asp:LinkButton class="tbbutton" ID="btnAddRole" runat="server" OnClientClick="return onAddRole();"
                                                OnClick="btnAddRole_OnClick">
                                                <img src="Images/AddRecord.gif" /><asp:Label ID="label5" runat="server" Text="Add"></asp:Label>
                                            </asp:LinkButton>
                                            <asp:LinkButton class="tbbutton" ID="btnEditRole" runat="server" OnClientClick=" return onSaveRole();"
                                                OnClick="btnSaveRole_OnClick">
                                                <img src="Images/save.gif" /><asp:Label ID="label6" runat="server" Text="Save"></asp:Label>
                                            </asp:LinkButton>
                                            <asp:LinkButton class="tbbutton" ID="btnDeleteRole" runat="server" OnClientClick="return onRemoveRole();"
                                                OnClick="btnRemoveRole_OnClick">
                                                <img src="Images/Delete.gif" /><asp:Label ID="label7" runat="server" Text="Delete"></asp:Label>
                                            </asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                                <uc:RoleList Width="100%" ID='lstRoles' runat="server" AllowPaging="true" AllowSelecting="true"
                                    AllowSorting="true" SaveOnCommit="false" />
                                <asp:Label ID="labelHint" runat="server" class='labelNote'>(*) Check modified roles and click save</asp:Label>
                                <div style='height: 10px'>
                                    &nbsp;
                                </div>
                                <asp:Panel ID="panelErr" runat="server">
                                </asp:Panel>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
